\section{cd --- Change Directory}
\label{fn:cd}
\index{cd()}
\index{change directory}
\index{directory!changing}
\index{working directory}
\begin{rail}
CD : 'cd' '(' String ')' ;
\end{rail}

\verb+cd+ changes the location of the current working for \RLaB . This 
affects any search paths that contain \verb+.+ (full stop), representing the
current directory.  It also changes the directory in which the diary
files are written, and the directory in which the file read and write
functions work on.  The argument string supplies an absolute or
relative pathname which specifies the new directory.


\paragraph{Example}
\index{example of cd()}
\index{cd()!example}
\begin{verbatim}
> system("pwd")
/home/bradh
        0
> cd("rlab")
        1
> system("pwd")
/home/bradh/rlab
        0
> cd("../archived")
        1
> system("pwd")
/home/bradh/archived
        0
> // This is a sym-link on my machine
> cd("/linux")
        1
> system("pwd")
/usr/src/linux
        0
\end{verbatim}

See also: Page~\pageref{fn:system} \verb+system()+.

\newpage





